<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="node_modules/react/umd/react.development.js"></script>
    <script src="node_modules/react-dom/umd/react-dom.development.js"></script>
    <script src="node_modules/babel-standalone/babel.min.js"></script>
</head>

<body>
    <div id="app"></div>
    <script type="text/babel">
        let text = '你好'
        let num = 500
        function fun(obj) {
            return '姓名是：' + obj.name + ',年龄是：' + obj.age
        }
        let user = {
            name: '张三',
            age: 18
        }
        // 使用表达式：{表达式}
        let ele = (<div>
            <div>{text}</div>
            <p>{num}</p>
            {/* 计算 */}
            <p>{num + 1}</p>
            {/* 使用函数 */}
            <div>{fun(user)}</div>
        </div>)
        ReactDOM.render(ele, document.getElementById('app'))
    </script>
</body>

</html>